
#define MAX_CHARS_PER_LINE  1024
//#define KEY_START_LINE			"-----BEGIN PRIVATE KEY-----\n"
//#define KEY_END_LINE				"-----END PRIVATE KEY-----\n"

static const string priv_key_start1 = "-----BEGIN PRIVATE KEY-----";
static const string priv_key_start2 = "-----BEGIN RSA PRIVATE KEY-----";
static const string priv_key_end1 =  "-----END PRIVATE KEY-----";
static const string priv_key_end2 =  "-----END RSA PRIVATE KEY-----";

static const string pub_key_start = "-----BEGIN PUBLIC KEY-----";
static const string pub_key_end		= "-----END PUBLIC KEY-----";

static const string cert_start = "-----BEGIN CERTIFICATE-----" ;
static const string cert_end = "-----END CERTIFICATE-----" ;

class base64
{
	public:
	
	string decodeBase64(string input);
	string encodeBase64(string input);
	
	bool decodeKeyFromBase64(const char *in, const char *out);
	bool encodeKeyToBase64(const char *in, const char *out);

	// utility functions
	string removeBegindAndEndLines(string str);
};
